package main

import (
	"github.com/nsqio/go-nsq"
)

const (
	//addr = "127.0.0.1:4150"
	addr2 = "127.0.0.1:32772"
)

// 生产者
var (
	producer *nsq.Producer
	err      error
)

func main() {

	producer, err = nsq.NewProducer(addr2, nsq.NewConfig())
	producer.Publish("test", []byte("nihao"))
	if err != nil {
		panic(err)
	}
}
